package com.zhhh.domain;
// Generated 2019-10-11 15:23:22 by Hibernate Tools 3.4.0.CR1

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;


/**
 * BModeControl generated by hbm2java
 */
@Entity
@Table(name = "b_mode_control")
public class BModeControl implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer id;
	private String ctrlId;
	private String ctrlText;
	private String dataId;
	private String modeCode;
	private Integer ifFtp;
	private String reportUrl;
	
	private BMode mode;
	
	private Set<BModeEm> modeEms = new HashSet<BModeEm>();
	
	private Set<BModeOper> modeOpers = new HashSet<BModeOper>();

	public BModeControl() {
	}

	public BModeControl(String ctrlText, String dataId, String modeCode, String ctrlId, Integer ifFtp,
			String reportUrl) {
		this.ctrlText = ctrlText;
		this.dataId = dataId;
		this.modeCode = modeCode;
		this.ctrlId = ctrlId;
		this.ifFtp = ifFtp;
		this.reportUrl = reportUrl;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "ctrl_id", length = 40)
	public String getCtrlId() {
		return this.ctrlId;
	}

	public void setCtrlId(String ctrlId) {
		this.ctrlId = ctrlId;
	}

	@Column(name = "ctrl_text", length = 40)
	public String getCtrlText() {
		return this.ctrlText;
	}

	public void setCtrlText(String ctrlText) {
		this.ctrlText = ctrlText;
	}

	@Column(name = "data_id", length = 40)
	public String getDataId() {
		return this.dataId;
	}

	public void setDataId(String dataId) {
		this.dataId = dataId;
	}
	//,insertable=false,updatable=false
	@Column(name = "mode_code", length = 40)
	public String getModeCode() {
		return this.modeCode;
	}

	public void setModeCode(String modeCode) {
		this.modeCode = modeCode;
	}
	
	
	@Column(name = "if_ftp")
	public Integer getIfFtp() {
		return this.ifFtp;
	}

	public void setIfFtp(Integer ifFtp) {
		this.ifFtp = ifFtp;
	}

	@Column(name = "report_url")
	public String getReportUrl() {
		return this.reportUrl;
	}

	public void setReportUrl(String reportUrl) {
		this.reportUrl = reportUrl;
	}

	@ManyToOne(targetEntity = BMode.class)
	@org.hibernate.annotations.ForeignKey(name="none")
	@JoinColumn(name="mode_code", referencedColumnName="mode_code",insertable=false,updatable=false)
	
//	@ManyToOne(cascade = { CascadeType.ALL},fetch = FetchType.LAZY)
//	@JoinColumn(name = "mode_code",insertable=false,updatable=false)
	@JsonIgnore
	public BMode getMode() {
		return mode;
	}

	public void setMode(BMode mode) {
		this.mode = mode;
	}

	@OneToMany
	/**
	 * name  指关联表字段名称   referencedColumnName  指本表字段名称
	 */
	@JoinColumn(name="ctrl_code", referencedColumnName="ctrl_id")
	@org.hibernate.annotations.ForeignKey(name="none")
	//@OneToMany(fetch = FetchType.LAZY, mappedBy = "modeControl")
	public Set<BModeEm> getModeEms() {
		return modeEms;
	}

	public void setModeEms(Set<BModeEm> modeEms) {
		this.modeEms = modeEms;
	}

	@OneToMany
	@JoinColumn(name="ctrl_code", referencedColumnName="ctrl_id")
	@org.hibernate.annotations.ForeignKey(name="none")
	//@OneToMany(fetch = FetchType.LAZY, mappedBy = "modeControl")
	public Set<BModeOper> getModeOpers() {
		return modeOpers;
	}

	public void setModeOpers(Set<BModeOper> modeOpers) {
		this.modeOpers = modeOpers;
	}

}
